package adapter;

public class MediaAdapter implements MediaPlayer {

    AdvancedMediaPlayer advancedMediaPlayer;
    public MediaAdapter (String type)
    {
        if("vic".equalsIgnoreCase(type))
            advancedMediaPlayer=new VicPlayer();
        else if("mp4".equalsIgnoreCase(type))
            advancedMediaPlayer=new Mp4Player();

    }
    @Override
    public void play(String type, String filename) {
        if("mp4".equalsIgnoreCase(type))
            advancedMediaPlayer.playMp4(type,filename);
        if("vic".equalsIgnoreCase(type))
            advancedMediaPlayer.playVic(type,filename);
    }
}
